//
//  ArchiveManager.h
//  ArchiveManager
//
//  Created by liangchenliang on 2021/1/26.
//  Copyright © 2017年 liangchenliang. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "AFNetworking.h"
#import "SSZipArchive.h"

typedef void (^ManagerArrayBlock)(BOOL succeed,NSString *hostPath, NSArray *array,NSString *errormsg);
typedef void (^ManagerDownloadProgressBlock)(double progress);

@interface ArchiveManager : NSObject<SSZipArchiveDelegate>

@property (nonatomic, strong) NSString *cachesPath;
@property (nonatomic, strong) NSString *documentsPath;
@property (nonatomic, strong) NSString *currentPath;
@property (nonatomic, strong) NSFileManager *fileManager;

@property (nonatomic, assign) BOOL enableCache;

@property (nonatomic, copy) ManagerArrayBlock arrayBlock;
@property (nonatomic, copy) ManagerDownloadProgressBlock downloadProgressBlock;

+ (instancetype)manager;
+ (instancetype)sharedInstance;

- (ArchiveManager *)documentsPath;
- (ArchiveManager *)cachesPath;
    
- (void)deletedCurrentPath;
- (void)deletedPath:(NSString *)folderPath;
- (void)startRequest:(NSString *)urlString key:(NSString *)password;
- (void)createZipFile:(NSString *)zipPath contentPath:(NSString *)filePath withPassword:(NSString *)password;
@end
